package com.lenovo.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Repository;

import com.lenovo.dao.BaseDAO;
import com.lenovo.model.GUrlRecordLog;
import com.lenovo.service.UrlRecordLogService;

@Repository
public class UrlRecordLogServiceImpl implements UrlRecordLogService {

	@Resource
	private BaseDAO dao;

	@Override
	public List<GUrlRecordLog> browse() {
		return dao.listAll("GUrlRecordLog");
	}

	@Override
	public GUrlRecordLog load(String id) {
		return (GUrlRecordLog) dao.loadById(GUrlRecordLog.class, id);
	}

	@Override
	public boolean del(String id) {
		boolean status = false;
		try {
			dao.delById(GUrlRecordLog.class, id);
			status = true;
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return status;
	}

	@Override
	public boolean save(GUrlRecordLog log) {
		boolean status = false;
		try {
			dao.save(log);
			status = true;
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return status;
	}

	@Override
	public boolean update(GUrlRecordLog log) {
		boolean status = false;
		try {
			dao.update(log);
			status = true;
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return status;
	}

}
